<?php
defined('IN_YuLin') || exit('NO PERMIT!');
 
$table = Table('admin_banner');

$pc_page_arr = array('/index'=>'首页','/cp'=>'购彩大厅','/mobile_cp'=>'手机购彩','/active'=>'活动中心','/help'=>'帮助指南','other'=>'其他');
$mobile_page_arr = array('/index'=>'首页','/active'=>'活动中心','/user'=>'我的账户','/down'=>'APP下载','other'=>'其他');

//编辑
if(IS_POST){
    //清除历史数据
   $db->exec('DELETE FROM '.$table.' WHERE  bn_type=1 or bn_type=2');
    //添加新数据
   foreach ($_POST['logo'] as $k=>$v){
       $data['bn_type'] = intval($v['type']);
       $data['bn_pic'] = NoBadStr($v['pic']);
       $data['bn_code'] = NoBadStr($v['url']);
       $data['bn_url'] = NoBadStr($v['bn_url']);  
       $data['dateline'] = time();
       $db->exec('INSERT INTO '.$table.CreateInsertSql($data));
   }
   ShowMsg('操作成功',U($m.'/'.$c));
    
}
//列表
$pc_arr = $db->getall('select * from '.$table.' where bn_type =1');
 
$mobile_arr = $db->getall('select * from '.$table.' where bn_type =2');

$tpl->display($m.'/'.$c);
